﻿using System;
using System.Reflection;

namespace ValidationHelper
{
    internal static class ReflectionUtil
    {
        public static object GetObject(object obj, string property)
        {
            return obj.GetType().GetProperty(property).GetValue(obj, null);
        }

        public static string GetStringObject(object obj, string property)
        {
            return GetObject(obj, property).ToString();
        }

        public static double GetDouble(object obj, string property)
        {
            return Convert.ToDouble(GetObject(obj, property));
        }
    }
}
